package com.hc.serviceimp;

import javax.servlet.http.HttpServletRequest;

import com.hc.dao.UserDao;
import com.hc.daoimp.UserDaoImpl;
import com.hc.entity.User;
import com.hc.service.UserService;

public class UserServiceImpl implements UserService {

	@Override
	public boolean login(String username, String password, HttpServletRequest request) {
		
		UserDao uDao=new UserDaoImpl();
		User user = uDao.getUser(username, password);
		if (user.getUname()!=null) {
			System.out.println("登陆成功");
			
			request.setAttribute("user", user);
			return true;
		}else{
			return false;
		}
		
		
		
	}

}
